<?php

 /**
  * @package JooS
  * @subpackage PHPackager
  */

  require_once "JooS/PHPackager/Relation/Abstract.php";

  class JooS_PHPackager_Relation_Package extends JooS_PHPackager_Relation_Abstract {
    private $_operator = null;

    private $_version = null;

    /**
     * @return string
     */
    public function __toString() {
      $str = "Package '" . $this->getName();
      if ($this->getOperator() !== null && $this->getVersion() !== null) {
        $str .= " " . $this->getOperator() . " " . $this->getVersion();
      }
      $str .= "'";
      return $str;
    }

    /**
     * @param string $operator
     * @return JooS_PHPackager_Relation_Package
     */
    public function setOperator($operator) {
      $this->_operator = $operator;

      return $this;
    }

    /**
     * @return string
     */
    public function getOperator() {
      return $this->_operator;
    }

    /**
     * @param string $version
     * @return JooS_PHPackager_Relation_Package
     */
    public function setVersion($version) {
      $this->_version = $version;

      return $this;
    }

    /**
     * @return string
     */
    public function getVersion() {
      return $this->_version;
    }
  }
